package com.ease.framework.gef4p.model {
   import mx.collections.ArrayCollection;

   public class Node extends Vertex {

      private var _pool:Pool;

      private var inEdges:ArrayCollection = new ArrayCollection();

      private var outEdges:ArrayCollection = new ArrayCollection();

      public function Node() {
      }

      public function geInEdges():ArrayCollection {
         return inEdges;
      }

      public function addInEdge(edge:Edge):void {
         inEdges.addItem(edge);
      }

      public function removeInEdge(edge:Edge):void {
         if (inEdges.contains(edge)) {
            inEdges.removeItemAt(inEdges.getItemIndex(edge));
         }
      }

      public function removeInEdges():void {
         inEdges.removeAll();
      }

      public function geOutEdges():ArrayCollection {
         return outEdges;
      }

      public function addOutEdge(edge:Edge):void {
         outEdges.addItem(edge);
      }

      public function removeOutEdge(edge:Edge):void {
         if (outEdges.contains(edge)) {
            outEdges.removeItemAt(outEdges.getItemIndex(edge));
         }
      }

      public function removeOutEdges():void {
         outEdges.removeAll();
      }

      public function set pool(pool:Pool):void {
         this._pool = pool;
      }

      public function get pool():Pool {
         return _pool;
      }
   }
}